RatcliffObershelp

Implements Ratcliff/Obershelp pattern recognition (Ratcliff & Metzener, 1988), also known as Gestalt pattern matching, similarity between strings.

The similarity is defined as \(D_{ro} = \frac{2K_m}{\lVert X \rVert + \lVert Y \rVert}\). Where \(K_m\) us the number of matching characters.

The distance is computed as \(1 - similarity(X, Y)\).

References

Ratcliff, J., & Metzener, D. E. (1988-07-01). Pattern matching: The gestalt approach. Dr. Dobb’s Journal, 13(7), 46. https://www.drdobbs.com/database/pattern-matching-the-gestalt-approach/184407970?pgno=5

Author

Ligi, solonovamax, Ported to java from .net by denmase

Functions

Link copied to clipboard
open override fun distance(s1: String, s2: String): Double

Computes the Ratcliff-Obershelp distance of two strings.

Link copied to clipboard
open override fun similarity(s1: String, s2: String): Double

Compute the Ratcliff-Obershelp similarity between strings.